//
//  UIImage+Optimize.h
//  CheFu365
//
//  Created by safiri on 2017/10/28.
//  Copyright © 2017年 safiri. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIImage (Optimize)

#pragma mark - size
/**
 按照UIImageView的尺寸,提前对图片进行拉伸/缩放处理,设置一致后再将图片设置给UIImageView,防止Color misaligned images
 */
- (UIImage *)zsScaleImageWithSize:(CGSize)size;
- (void)zsScaleImageWithSize:(CGSize)size completion:(void(^)(UIImage *img))completion;
#pragma mark - circle
/**
 同步生成指定大小圆形图片

 @param size 圆形图片直径
 @param fillColor 圆形图片外填充颜色，一般与父View背景颜色一致，可防止color blended layers
 @return 图片
 */
- (UIImage *)zsCircleImageWithSize:(CGSize)size fillClolor:(UIColor *)fillColor;
/**
 异步生成圆形图片
 */
- (void)zsCornerImageWithSize:(CGSize)size fillClolor:(UIColor *)fillColor completion:(void(^)(UIImage *img))completion;


/**
 同步生成默认大小圆形图片

 @param fillColor 圆形图片外填充颜色，一般与父View背景颜色一致，可防止color blended layers
 @return 图片
 */
- (UIImage *)zsCircleImageFillClolor:(UIColor *)fillColor;
- (void)zsCircleImageFillClolor:(UIColor *)fillColor completion:(void(^)(UIImage *img))completion;


/**
 同步生成指定大小圆形图片，含alpha，无法防止color blended layers

 @param size 指定大小
 @return 图片
 */
- (UIImage *)zsCircleImageWithSize:(CGSize)size;

/**
 同步生成默认大小圆形图片，含alpha，无法防止color blended layers
 */
- (UIImage *)zsCircleImage;



@end
